#ifndef __MAX6675_DRV_H
#define __MAX6675_DRV_H

#include "_config_cpu_.h"
#include "_config_cpu_spi.h"
#include "_config_lib_sensor.h"

#if (MAX6675_USE_SPI == 1)
	#if defined(cortexm3)
	#include "ssp1.h"
	#define max6675_TransferByte(c)	ssp1_TransferByte(c)
	#else
	#include "spi1.h"
	#define max6675_TransferByte(c)	spi1_TransferByte(c)
	#endif

#elif (MAX6675_USE_SPI == 0)
	#if defined(cortexm3)
	#include "ssp0.h"
	#define max6675_TransferByte(c)	ssp0_TransferByte(c)
	#else
	#include "spi0.h"
	#define max6675_TransferByte(c)	spi0_TransferByte(c)
	#endif
#else
	#error NÃO FOI DEFINIDO A PORTA SPI PARA O MAX6675 EM _config_cpu_spi.h
#endif

// FUNCTIONS
void max6675_SetupPorts(void);
int max6675_Enable(int dev);
int max6675_Disable(int dev);

#endif
